package ieco.domaine;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(schema = "OPTIONS", name = "SERIES")
// @SequenceGenerator(schema = "OPTIONS", name = "SEQ_SERIE", sequenceName = "SERIES_ID_SEQ")
@SuppressWarnings("serial")
public class Serie implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;

	@Column(name = "code", nullable = true, unique = true)
	private String code;

	// Constructeur vide
	public Serie() {
	}

	// Constructeur complet
	public Serie(String code) {
		super();
		this.code = code;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Serie other = (Serie) obj;
		if (id != other.id)
			return false;
		return true;
	}

}
